﻿using System;
using System.Collections.Generic;
using System.Text;
using Watchdog.Dal;
using Watchdog.Bll;
using Watchdog.Bll.Base;

namespace Watchdog.Bll.Factory {

    public partial class NotificationFactory {
        public static void AddTest ( Notification notification, Test test ) {
			Dal.DataClient.Current.NotificationAddTest (notification.IntData, test.IntData );
		}
        public static void Delete ( NotificationBase notification ) {
            DataClient.Current.NotificationDelete ( notification.IntData );
        }

        public static Notification GetById ( int id ) {
            return new Notification (DataClient.Current.NotificationGetById (id));
        }
				
        public static List<Notification> GetByTest ( int test ) {
		    List<Notification> outlist = new List<Notification> ();
            Watchdog.Facade.Notification[] list = Dal.DataClient.Current.NotificationGetByTest ( test );
            foreach (Watchdog.Facade.Notification item in list)
                outlist.Add (new Notification (item));
            return outlist;
            // return DataClient.Current.NotificationGetByTest ( test );
        }
        public static void Insert ( NotificationBase notification ) {
            notification.IntData = DataClient.Current.NotificationInsert ( notification.IntData );
        }

        public static void RemoveTest ( Notification notification, Test test ) {
			Dal.DataClient.Current.NotificationRemoveTest (notification.IntData, test.IntData );
		}
        public static void Update ( NotificationBase notification ) {
            DataClient.Current.NotificationUpdate ( notification.IntData );
        }
		
	}
}
